Locking translated tags or blocks of code

In most cases, you want a translator to change markup so that Dreamweaver can display it, but you want the original markup—not the changes—to be saved. To address this need, Dreamweaver provides special XML tags in which to wrap translated content and to refer to the original code. The syntax of the XML tags is as follows:

<MM:BeginLock translatorClass="translatorClass" type="tagNameOrType"
depFiles="dependentFilesList" orig="encodedOrignalMarkup">Translated content
<MM:EndLock>

where:

translatorClass is the unique identifier for the translator (the first string in the array returned by getTranslatorInfo()).

tagNameOrType is a string identifying the type of markup (or the tag name associated with the markup) contained in the lock. The string can contain only alphanumeric, hyphen (-), or underscore (_) characters. You can check this value in the canInspectSelection() function of a custom property inspector to determine if the inspector is the right one for the content. For more information, see Creating property inspectors for locked content. Locked content cannot be inspected by any of Dreamweaver's built-in property inspectors. For example, specifying type="IMG" does not make the Image inspector appear.

dependentFilesList is a string containing a comma-separated list of files on which the locked markup depends. Files are referenced from the hard drive (for example, C:\sites\avocado8\copyright.html in Windows or MyHD:sites:avocado8:copyright.html on Macintosh). If the user updates one of the files in the dependentFilesList, Dreamweaver automatically retranslates the content in the document containing the list.

encodedOriginalMarkup is a string containing the original, untranslated markup, encoded using a small subset of URL encoding (use %22 for ", %3C for <, %3E for >, and %25 for %). The quickest way to URL encode a string is to use the escape() method. For example, if myString equals '<img src="foo.gif">', escape(myString) returns %3Cimg%20src=%22foo.gif%22%3E.

The following example shows the locked portion of code that might be generated from the translation of the server-side include <!--#include virtual="/footer.html" -->:

<MM:BeginLock translatorClass="MM_SSI" type="ssi" depFiles="C:\sites\webdev\footer.html" orig="%3C!--#include virtual=%22/footer.html%22%20--%3E"><!-- begin footer --><CENTER><HR SIZE=1 NOSHADE WIDTH=100%>
<BR>
[<A TARGET="_top" HREF="/">home</A>]
[<A TARGET="_top" HREF="/products/">products</A>]
[<A TARGET="_top" HREF="/services/">services</A>]
[<A TARGET="_top" HREF="/support/">support</A>]
[<A TARGET="_top" HREF="/company/">about us</A>]
[<A TARGET="_top" HREF="/help/">help</A>] 
</CENTER><!-- end footer --><MM:EndLock>